import { h } from 'vue';
import { NAvatar } from 'naive-ui';
import { BasicColumn } from '@/components/Table';
import { NTag, NButton, useMessage } from 'naive-ui'
export interface ListDataAboutLabBorrow {
  id: string;
  account:string
  username: string;
  major: string,
  class_name: string

}

export const columnsAboutLabBorrow: BasicColumn<ListData>[] = [
  
  {
    title: 'ID',
    key: 'id',
    width: 100,
  },
  {
    title: '实验室名称',
    key: 'labName',
    width: 100,
  },
  {
    title: '起始周',
    key: 'startWeek',
    width: 100,
  },
  {
    title: '结束周',
    key: 'endWeek',
    width: 100,
  },
  {
    title: '原因',
    key: 'reason',
    width: 150,
  },
  {
    title: '节次',
    key: 'section',
    width: 100,
  },
  {
    title: '状态',
    key: 'state',
    width: 100,
    render (row) {
      console.log("row",row)
      if(row.state == 0){
        //未审核
        return h(
          NTag,
          {
            style: {
              marginRight: '6px'
            },
            // type: 'info',
            bordered: false
          },
          {
            default: () => "未审核"
          }
        )
      }else if(row.state == 1){
        //通过
        return h(
          NTag,
          {
            style: {
              marginRight: '6px'
            },
            type: 'success',
            bordered: false
          },
          {
            default: () => "通过"
          }
        )
      }else if(row.state == 2){
        //驳回
        return h(
          NTag,
          {
            style: {
              marginRight: '6px'
            },
            type: 'error',
            bordered: false
          },
          {
            default: () => "驳回"
          }
        )
      }else if(row.state == 3){
        //使用完毕
        return h(
          NTag,
          {
            style: {
              marginRight: '6px'
            },
            type: 'warning',
            bordered: false
          },
          {
            default: () => "使用完毕"
          }
        )
      }
        
      
    }
  }
  
];


